package edu.uclmgmu.bacteriosec.aspects.readAheadInputStream;

import com.mysql.jdbc.util.ReadAheadInputStream;

import edu.uclmgmu.bacteriosec.aspects.common.Store;

privileged aspect ReadAheadInputStream_CountCalls {

	int around(com.mysql.jdbc.util.ReadAheadInputStream f, byte[] b, int off, int len) :
							target(f) && args(b, off, len) &&  call(* ReadAheadInputStream.read(byte[], int, int)) {                 
		int counter=Store.get(thisJoinPointStaticPart.getSignature());
		Store.updateNumberOfCalls(thisJoinPointStaticPart.getSignature(), counter++);
		Store.put(thisJoinPointStaticPart.getSignature(), counter);
		return proceed(f, b, off, len);
	}
}
